function sort(arr){
    let len  = arr.length;
    for(let i = 0;i < len;i++){
        let random = Math.floor(Math.random()*(len-i))+i;
        [arr[i],arr[random]] = [arr[random],arr[i]];
    }
}
let arr = [1,2,3,4,5,6,7];
sort(arr);
console.log(arr);